//
//  ViewController.swift
//  autoTest
//
//  Created by 寒山 on 2019/1/22.
//  Copyright © 2019 江稳. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet var userNameTextField: UITextField!
    @IBOutlet var passwordTextField: UITextField!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }


    @IBAction func loginAction(_ sender: Any) {
        if userNameTextField.text == "jiangwen" && passwordTextField.text == "123456"{
            print("登陆成功")
        }else{
            let alert = UIAlertController(title: "提示", message: "登录失败", preferredStyle: .alert)
            let action = UIAlertAction(title: "确定", style: .destructive, handler: nil)
            alert.addAction(action)
            self.present(alert, animated: true, completion: nil)
        }
    }
}

